package edu.ucuenca.tc.listenandtouch;



import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Gallery;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;

public class PrincipalActividad extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.categorias);
        
        Gallery gallery = (Gallery)findViewById(R.id.gallery);
        gallery.setAdapter(new AdaptadorImagen(this));

        gallery.setOnItemClickListener(new OnItemClickListener() {
        	@Override
        	public void onItemClick(AdapterView parent, View v, int position, long id) {
            	Intent intento=new Intent();
            	intento.setClass(PrincipalActividad.this, ModosActividad.class); 
            	intento.putExtra("tipo", position);
            	startActivity(intento);
            }

        });
    }

    public void  loadCategoriastoModo1(View view){
    	Intent intento=new Intent();
    	intento.setClass(this, ModosActividad.class); 
    	startActivity(intento);
    	//intento.putExtra("total", total);
    }

   /* @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.principal_actividad, menu);
        return true;
    }*/
    
}
